<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link type="text/css" rel="stylesheet" href="/TP/Public/css/style.css" />
    <!--[if IE 6]>
    <script src="/TP/Public/js/iepng.js" type="text/javascript"></script>
        <script type="text/javascript">
           EvPNG.fix('div, ul, img, li, input, a'); 
        </script>
    <![endif]-->
    
    <script type="text/javascript" src="/TP/Public/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="/TP/Public/js/menu.js"></script>    
                
	<script type="text/javascript" src="/TP/Public/js/n_nav.js"></script>   
    
    <script type="text/javascript" src="/TP/Public/js/select.js"></script>
    
    <script type="text/javascript" src="/TP/Public/js/num.js">
    	var jq = jQuery.noConflict();
    </script>     
    
    <script type="text/javascript" src="/TP/Public/js/shade.js"></script>
    
<title>数码商城</title>
</head>
<body>  
<!--Begin Header Begin-->
<div class="soubg">
	<div class="sou">
        <span class="fr">
        	<span class="fl">
                <?php if(empty($username)): ?>你好，请<a href="<?php echo U('Home/Login/index');?>">登录</a>&nbsp; <a href="<?php echo U('Home/User/Regist');?>" style="color:#ff4e00;">免费注册　</a>
                <?php else: ?>
                    你好&nbsp;<?php echo ($username); ?>&nbsp;<a href="<?php echo U('Home/index/tuichu');?>">退出</a><?php endif; ?> 
            <a href="<?php echo U('Home/member/index');?>">&nbsp;|个人中心</a>&nbsp;|
            </span>
        	　<span class="ss">
            	<div class="ss_list">
                	<a href="#">收藏夹</a>
                    <div class="ss_list_bg">
                    	<div class="s_city_t"></div>
                        <div class="ss_list_c">
                        	<ul>
                            	<li><a href="<?php echo U('Home/member/Member_Collect');?>">我的收藏夹</a></li>
                            </ul>
                        </div>
                    </div>     
                </div>
                <div class="ss_list">
                	<a href="#">客户服务</a>
                    <div class="ss_list_bg">
                    	<div class="s_city_t"></div>
                        <div class="ss_list_c">
                        	<ul>
                            	<li><a href="#">客户服务</a></li>
                                <li><a href="#">客户服务</a></li>
                                <li><a href="#">客户服务</a></li>
                            </ul>
                        </div>
                    </div>    
                </div>
                <div class="ss_list">
                	<a href="#">网站导航</a>
                    <div class="ss_list_bg">
                    	<div class="s_city_t"></div>
                        <div class="ss_list_c">
                        	<ul>
                            	<li><a href="#">网站导航</a></li>
                                <li><a href="#">网站导航</a></li>
                            </ul>
                        </div>
                    </div>    
                </div>
            </span>
            <span class="fl">|&nbsp;关注我们：</span>
            <span class="s_sh"><a href="#" class="sh1">新浪</a><a href="#" class="sh2">微信</a></span>
            <span class="fr">|&nbsp;<a href="#">手机版&nbsp;<img src="/TP/Public/images/s_tel.png" align="absmiddle" /></a></span>
        </span>
    </div>
</div>
<div class="top">
    <div class="logo"><img src="/TP/Public/images/logo.jpg" width="200" height="60" /></div>
     <div class="search">
      <form method="get" action="<?php echo U('home/list/seach');?>">
          <input type="text" name="seach" class="s_ipt" />
            <input type="submit" value="搜索" class="s_btn" />
        </form>                      
    </div>
    <!-- onmouseover="mouserover('user')"  [ <span>3</span> ] -->
    <div class="i_car" >
    	<div class="car_t" >购物车</div>
        <div class="car_bg">
       	
        <?php  if($_SESSION['user']['id']){ $buycar = M('buycar'); $map['uid'] = ['eq',session('user')['id']]; $blist = $buycar->where($map)->select(); echo ' <ul class="cars">'; foreach($blist as $blist){ echo '
                          <li>
                          <div class="img"><a href="#"><img src="/TP/Uploads/comm/'.$blist['goodspic'].'" width="58" height="58" /></a></div>
                            <div class="name"><a href="#">'.$blist['goodsname'].'</a></div>
                            <div class="price"><font color="#ff4e00">'.$blist['price'].'￥</font> X'.$blist['number'].'</div>
                          </li>
        
                      '; } echo '  </ul>'; }else{ echo '<div class="un_login">还未登录<a href="/TP/Home/Login/index.html" style="color:#ff4e00;">马上登录</a> 查看购物车！</div>'; } ?>

        </div>
    </div>
</div>
<script>
    // function mouserover(user){
    //     jq.get("<?php echo U('Home/Header/header');?>",{'user':user},function(data){
    //       // alert(data);
    //     });
    // }

</script>
<!--End Header End--> 
<!--Begin Menu Begin-->
<div class="menu_bg">
	<div class="menu">
    	<!--Begin 商品分类详情 Begin-->    
    	<div class="nav">
        	<div class="nav_t">全部商品分类</div>
            <div class="leftNav none">
                <ul>      
                    <?php if(is_array($t_list)): $i = 0; $__LIST__ = $t_list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$t_list): $mod = ($i % 2 );++$i;?><li>
                        <div class="fj">
                            <span class="n_img"><span></span><img src="/TP/Public/images/nav1.png" /></span>
                            <span class="fl"><?php echo ($t_list["name"]); ?></span>
                        </div> 
                        <?php if(!empty($t_list['lower'])): ?><div class="zj">
                            <div class="zj_l">
                             <?php if(is_array($t_list[lower])): $i = 0; $__LIST__ = $t_list[lower];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$w_list): $mod = ($i % 2 );++$i;?><div class="zj_l_c">
                                    <h2><a href="<?php echo U('Home/List/index',['id'=>$w_list['id']]);?>"><?php echo ($w_list['name']); ?></a></h2>
                                    <?php if(!empty($w_list['lower'])): if(is_array($w_list['lower'])): $i = 0; $__LIST__ = $w_list['lower'];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$e_list): $mod = ($i % 2 );++$i;?><a href="<?php echo U('Home/List/index',['id'=>$e_list['id']]);?>"><?php echo ($e_list['name']); ?></a>|<?php endforeach; endif; else: echo "" ;endif; endif; ?>
                                </div><?php endforeach; endif; else: echo "" ;endif; ?>
                            </div>
                        
                        </div><?php endif; ?>
                    </li><?php endforeach; endif; else: echo "" ;endif; ?>	
                </ul>            
            </div>
        </div>  
        <!--End 商品分类详情 End-->                                                     
    	<ul class="menu_r">
		<!--导航-->
					<li><a href="/TP/index.php">首页</a></li>
            <?php if(is_array($bar)): foreach($bar as $key=>$bar): ?><li><a href="<?php echo U('Home/list/index',['id'=>$bar['id']]);?>"><?php echo ($bar["name"]); ?></a></li>
     <!--        <li><a href="Fresh.html">生鲜</a></li>
            <li><a href="HomeDecoration.html">家居</a></li>
            <li><a href="SuitDress.html">女装</a></li>
            <li><a href="MakeUp.html">美妆</a></li>
            <li><a href="Digital.html">数码</a></li>
            <li><a href="GroupBuying.html">团购</a></li> --><?php endforeach; endif; ?>
        </ul>
       
    </div>
</div>
<!--End Menu End--> 
<div class="i_bg">  
    <div class="content mar_20">
    	<img src="/TP/Public/images/img2.jpg" />        
    </div>
    
    <!--Begin 第二步：确认订单信息 Begin -->
    <div class="content mar_20">
    	<div class="two_bg">
        	<div class="two_t">
            <!-- <a href="<?php echo U('Home/Buycar/index');?>">修改</a> -->
            	<span class="fr"></span>商品列表
            </div>
            <table border="0" class="car_tab" style="width:1110px;" cellspacing="0" cellpadding="0">
              <tr>
                <td class="car_th" width="550">商品名称</td>
                <td class="car_th" width="140">属性</td>
                <td class="car_th" width="150">购买数量</td>
                <td class="car_th" width="150">积分</td>
                <td class="car_th" width="130">小计</td>
                <!-- <td class="car_th" width="140">返还积分</td> -->
              </tr>

              <?php if(is_array($list)): foreach($list as $key=>$val): ?><tr class="car_tr">
                <td>
                    <div class="c_s_img"><img src="/TP/Uploads/comm/<?php echo ($val["goodspic"]); ?>" width="73" height="73" /></div>
                    <?php echo ($val["goodsname"]); ?>
                </td>
                <td align="center">颜色：<?php echo ($val["color"]); ?><br></td>
                <td align="center"><?php echo ($val["number"]); ?></td>
                <td align="center"><?php echo ($val["integral"]); ?></td>
                <td align="center" style="color:#ff4e00;">￥<?php echo ($val["total"]); ?></td>
               <!--  <td align="center">26R</td> -->
              </tr><?php endforeach; endif; ?> 
              <tr>
                <td colspan="5" align="right" style="font-family:'Microsoft YaHei';">
                    商品总价：￥<?php echo ($total); ?> 
                </td>
              </tr>
            </table>
            
            <div class="two_t">
            	<span class="fr"></span>收货人信息
            </div>
            <!-- 表单 -->
            <form action="<?php echo U('Home/Orders/flash');?>" method="post">
            <table border="0" class="peo_tab" style="width:1110px;" cellspacing="0" cellpadding="0">
            <tr>
                <th>收货人</th>
                <th>手机号码</th>
                <th>详细地址</th>
                <th>邮政编码</th>
                <th>选中</th>
                <th>编辑</th>
            </tr>
            <?php if(empty($address)): ?><tr> 
                <!-- <td class="p_td" width="160">收货人</td> -->
                <td width="200"><input type="text" style="width:100px" id="linkman" name="linkman" value="" /></td>
                <!-- <td class="p_td" width="160">手机号码</td> -->
                <td width="200"><input type="text" style="width:100px" id="phone" name="phone" value="" /></td>
                <!-- <td class="p_td" width="160">详细地址</td> -->
                <td width="200"><textarea type="text" clos="2" rows="2" id="address" name="address" value=""></textarea></td>
                <!-- <td class="p_td" width="160">邮政编码</td> -->
                <td width="150"><input type="text" style="width:100px" id="code" name="code" value="" /></td>
                <td><input type="radio" value="" name="id"/></td>
                <td><i onclick="add_address()">保存</i></td>
                <!-- <input type="radio" />adfad -->
              </tr>
            
            <?php else: ?>
            <?php if(is_array($address)): foreach($address as $key=>$address): ?><tr> 
                <!-- <td class="p_td" width="160">收货人</td> -->
                <td width="200"><input type="text" style="width:100px" id="linkman<?php echo ($address["id"]); ?>" name="linkman" value="<?php echo ($address["linkman"]); ?>" /></td>
                <!-- <td class="p_td" width="160">手机号码</td> -->
                <td width="200"><input type="text" style="width:100px" id="phone<?php echo ($address["id"]); ?>" name="phone" value="<?php echo ($address["phone"]); ?>" /></td>
                <!-- <td class="p_td" width="160">详细地址</td> -->
                <td width="200"><textarea type="text" clos="2" rows="2" id="address<?php echo ($address["id"]); ?>" name="address" value=""><?php echo ($address["address"]); ?></textarea></td>
                <!-- <td class="p_td" width="160">邮政编码</td> -->
                <td width="150"><input type="text" style="width:100px" id="code<?php echo ($address["id"]); ?>" name="code" value="<?php echo ($address["code"]); ?>" /></td>
                <td><input type="radio" <?php echo ($address['status']==1?checked:""); ?> value="<?php echo ($address["id"]); ?>" name="id"/></td>
                <td><i onclick="up_address(<?php echo ($address["id"]); ?>)">保存修改</i></td>
                <!-- <input type="radio" />adfad -->
              </tr><?php endforeach; endif; endif; ?>
            </table>
            <table border="0" style="width:900px; margin-top:20px;" cellspacing="0" cellpadding="0">
              <tr>
                <td align="right">
                	该订单完成后，您将获得 <font color="#ff4e00"><?php echo ($integral); ?></font>的积分
                    商品总价: <font color="#ff4e00">￥<?php echo ($total); ?></font> 
                </td>
              </tr>
              <tr height="70">
                <td align="right">
                	<b style="font-size:14px;">应付款金额：<span style="font-size:22px; color:#ff4e00;">￥<?php echo ($total); ?></span></b>
                </td>
              </tr>
              <tr height="70">
                <!-- <td align="right"><a href="#"><img src="/TP/Public/images/btn_sure.gif" /></a></td> -->
                <td align="right"><input type="submit" value=""style="background-image:url(/TP/Public/images/btn_sure.gif);width:180px;height:45px;border:none"/></td>      
              </tr>
            </table>
            </form>

            
        	
        </div>
    </div>
	<!--End 第二步：确认订单信息 End-->
    
    
    <!--Begin Footer Begin -->
     <div class="b_btm_bg b_btm_c">
        <div class="b_btm">
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
              <tr>
                <td width="72"><img src="/TP/Public/images/b1.png" width="62" height="62" /></td>
                <td><h2>正品保障</h2>正品行货  放心购买</td>
              </tr>
            </table>
			<table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
              <tr>
                <td width="72"><img src="/TP/Public/images/b2.png" width="62" height="62" /></td>
                <td><h2>满38包邮</h2>满38包邮 免运费</td>
              </tr>
            </table>
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
              <tr>
                <td width="72"><img src="/TP/Public/images/b3.png" width="62" height="62" /></td>
                <td><h2>天天低价</h2>天天低价 畅选无忧</td>
              </tr>
            </table>
            <table border="0" style="width:210px; height:62px; float:left; margin-left:75px; margin-top:30px;" cellspacing="0" cellpadding="0">
              <tr>
                <td width="72"><img src="/TP/Public/images/b4.png" width="62" height="62" /></td>
                <td><h2>准时送达</h2>收货时间由你做主</td>
              </tr>
            </table>
        </div>
    </div>
    <div class="b_nav">
    	<dl>                                                                                            
        	<dt><a href="#">新手上路</a></dt>
            <dd><a href="#">售后流程</a></dd>
            <dd><a href="#">购物流程</a></dd>
            <dd><a href="#">订购方式</a></dd>
            <dd><a href="#">隐私声明</a></dd>
            <dd><a href="#">推荐分享说明</a></dd>
        </dl>
        <dl>
        	<dt><a href="#">配送与支付</a></dt>
            <dd><a href="#">货到付款区域</a></dd>
            <dd><a href="#">配送支付查询</a></dd>
            <dd><a href="#">支付方式说明</a></dd>
        </dl>
        <dl>
        	<dt><a href="#">会员中心</a></dt>
            <dd><a href="#">资金管理</a></dd>
            <dd><a href="#">我的收藏</a></dd>
            <dd><a href="#">我的订单</a></dd>
        </dl>
        <dl>
        	<dt><a href="#">服务保证</a></dt>
            <dd><a href="#">退换货原则</a></dd>
            <dd><a href="#">售后服务保证</a></dd>
            <dd><a href="#">产品质量保证</a></dd>
        </dl>
        <dl>
        	<dt><a href="#">友情链接</a></dt>
            <?php if(is_array($link)): foreach($link as $key=>$link): ?><dd><a href="<?php echo ($link["linkaddress"]); ?>"><?php echo ($link["linkname"]); ?></a></dd><?php endforeach; endif; ?>
        </dl>
        <div class="b_tel_bg">
        	<a href="#" class="b_sh1">新浪微博</a>            
        	<a href="#" class="b_sh2">腾讯微博</a>
            <p>
            服务热线：<br />
            <span>400-123-4567</span>
            </p>
        </div>
        <div class="b_er">
            <div class="b_er_c"><img src="/TP/Public/images/er.gif" width="118" height="118" /></div>
            <img src="/TP/Public/images/ss.png" />
        </div>
    </div>    
    <div class="btmbg">
		<div class="btm">
        	备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com   Copyright © 2015-2018 尤洪商城网 All Rights Reserved. 复制必究 , Technical Support: Dgg Group <br />
            <img src="/TP/Public/images/b_1.gif" width="98" height="33" /><img src="/TP/Public/images/b_2.gif" width="98" height="33" /><img src="/TP/Public/images/b_3.gif" width="98" height="33" /><img src="/TP/Public/images/b_4.gif" width="98" height="33" /><img src="/TP/Public/images/b_5.gif" width="98" height="33" /><img src="/TP/Public/images/b_6.gif" width="98" height="33" />
        </div>    	
    </div>
    <!--End Footer End -->    
</div>
<script>
    //修改方法
    function up_address(id)
    {
        // alert(id);
        var l = "#linkman"+id;
        var p = "#phone"+id;
        var a = "#address"+id;
        var c = "#code"+id;
        //获取要修改的值
        var linkman = jq(l).val();
        var phone = jq(p).val();
        var address = jq(a).val();
        var code = jq(c).val();
        jq.get("<?php echo U('Home/orders/up_address');?>",{
            'linkman':linkman,
            'phone':phone,
            'address':address,
            'code':code,
            'id':id
        },function(data){
            alert(data);
        });
    }

    //添加新地址
    function add_address(){
        var linkman = jq('#linkman').val();
        var phone = jq('#phone').val();
        var address = jq('#address').val();
        var code = jq('#code').val();
        jq.get("<?php echo U('Home/orders/add_address');?>",{
            'linkman':linkman,
            'phone':phone,
            'address':address,
            'code':code,
        },function(data){
            if(data == '保存成功'){
                window.location.reload();
            }
        });
    }
</script>
</body>


<!--[if IE 6]>
<script src="/TP/Public///letskillie6.googlecode.com/svn/trunk/2/zh_CN.js"></script>
<![endif]-->
</html>